<template>
  <div :style='[style, {borderStyle: "none"}]' @click="emitSelect">
    <img :style='[style, {transform: "rotate(0deg)"}]' :src="item.src" alt="">
    <v-operator v-if="item.editting" :item="item"></v-operator>
  </div>
</template>
<style lang="scss" scoped>
img {
  width: 100%;
  display: block;
  box-sizing: border-box;
}
</style>

<script>
import packStyle from '@/util/packStyle.js'
export default {
  name: 'vImage',
  props: [
    'item'
  ],
  data () {
    return {

    }
  },
  methods: {
    emitSelect: function () {
      this.$emit('select', this.item)
    }
  },
  computed: {
    style () {
      return packStyle(this.item.style)
    }
  }
}
</script>
